<%@ page language="java" import="java.util.*"
	contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<h2 class="contentTitle">在线考试系统---正在考试：${tkname }</h2>
<script type="text/javascript">
	function checkbz(a) {
		$(a).find("span").show();
		return iframeCallback(a, navTabAjaxDone);
	}
	function checks(a) {
		var ids = new Array();
		var Jqform = $(a);
		if ($(a).find("input.dxbz:checked").size() < 2) {
			alert("请选择多个答案！");
			return false;
		}
		$(a).find("input.dxbz:checked").each(function(i, obj) {
			ids[i] = $(obj).val();
		});
		var idStr = ids.join("");
		$(a).children("input#zq3").val(idStr);
		$(a).find("span").show();
		return iframeCallback(a, navTabAjaxDone);
	}
</script>
<table class="list" width="50%" layoutH="60">
	<tr>
		<th colspan="4"><h2>以下为单项选择题(总分：${t1score } )</h2></th>
	</tr>
	<c:forEach varStatus="s" items="${zxkstm1List }" var="item">
		<tr>
			<td>
				<form action="<c:url value='tmcurd.do?method=checka&ifzc=1'/>"
					method="post" onsubmit="return checkbz(this);">
					<input type="hidden" name="id" value="${item.id}" />
					<table class="table" width="100%">
						<tr>
							<td colspan="4">${s.index + 1}: ${item.tm}</td>
						</tr>
						<tr>
							<td><label> A <input type="radio"
									${item.lsda eq 'A' ? 'selected="selected"':''} name="lsda"
									value="A" /></label></td>
							<td>${item.d1}</td>
							<td><label> B <input type="radio"
									${item.lsda eq 'B' ? 'selected="selected"':''} name="lsda"
									value="B" /></label></td>
							<td>${item.d2}</td>
						</tr>
						<tr>
							<td><label> C <input type="radio"
									${item.lsda eq 'C' ? 'selected="selected"':''} name="lsda"
									value="C" /></label></td>
							<td>${item.d3}</td>
							<td><label> D <input type="radio"
									${item.lsda eq 'D' ? 'selected="selected"':''} name="lsda"
									value="D" /></label></td>
							<td>${item.d4}</td>
						</tr>
						<tr>
							<td colspan="4"><label>题目分数</label> ${item.fs} ----
								<button type="submit">保存</button> <span style="display:none">正确答案:
									${item.zq} </span></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<th colspan="4"><h2>以下为多项选择题(总分：${t2score } )</h2></th>
	</tr>
	<c:forEach varStatus="s" items="${zxkstm2List }" var="item">
		<tr>
			<td>
				<form action="<c:url value='tmcurd.do?method=checka&ifzc=1'/>"
					method="post" onsubmit="return checks(this);">
					<input type="hidden" name="id" value="${item.id}" /> <input
						type="hidden" name="lsda" id="zq3" value="${item.lsda}" />
					<table class="table" width="100%">
						<tr>
							<td colspan="4">${s.index + 1}: ${item.tm}</td>
						</tr>
						<tr>
							<td><label> A <input type="checkbox"
									${fn:contains(item.lsda,'A') ? 'selected="selected"':''}
									name="lsda2" class="dxbz" value="A" /></label></td>
							<td>${item.d1}</td>
							<td><label> B <input type="checkbox"
									${fn:contains(item.lsda,'B') ? 'selected="selected"':''}
									name="lsda2" class="dxbz" value="B" /></label></td>
							<td>${item.d2}</td>
						</tr>
						<tr>
							<td><label> C <input type="checkbox"
									${fn:contains(item.lsda, 'C') ? 'selected="selected"':''}
									name="lsda2" class="dxbz" value="C" /></label></td>
							<td>${item.d3}</td>
							<td><label> D <input type="checkbox"
									${fn:contains(item.lsda, 'D') ? 'selected="selected"':''}
									name="lsda2" class="dxbz" value="D" /></label></td>
							<td>${item.d4}</td>
						</tr>
						<tr>
							<td colspan="4"><label>题目分数</label> ${item.fs} ----
								<button type="submit">保存</button> <span style="display:none">正确答案:
									${item.zq} </span></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td align="center"><button>
				<a href="tmcurd.do?method=csjj&cjid=${cjid }&ifzc=1" target="navTab"
					rel="csjj" title="交卷"> 交 卷 </a>
			</button></td>
	</tr>

</table>

